<template>
    <div class="teamplate-pop">
    <div class="msg-pop" :class="popPerfect.pop?'on':''" id="j_msg_pop" >
        <div class="title">信息<i class="iconfont icon-guanbi close" data-tag="pop" @click="closePop"></i></div>
        <div class="bd">{{msg}}</div>
        <div class="fd"><input type="button" value="确认" data-tag="pop" @click="onConfirm" class="confirm" id="j_msg_pop_confirm"></div>
    </div>
    </div>
</template>

<script>
import bus from "../api/eventBus";
import { popPerfect } from "../vuex/getters";
import { setpopPerfect } from "../vuex/actions";
export default {
  vuex: {
    getters: {
      popPerfect
    },
    actions: {
      setpopPerfect
    }
  },
  components: {},
  data() {
    return {
      msg: {}
    };
  },
  methods: {
    onConfirm(e,cb) {
      let me = this;
      let tag = e.currentTarget.dataset.tag;
      me.setpopPerfect(tag, false);
      cb && cb();
    },
    closePop(e) {
      let me = this;
      let tag = e.target.dataset.tag;
      me.setpopPerfect(tag, false);
    }
  },
  mounted() {
    let me = this;

    bus.$on("myTest", obj => {
      me.msg = obj.a;
    });
  }
};
</script>